Skip to content

fix: bind UI to loopback only - #2

Merged
karozadev merged 2 commits into
karozadev:mainfrom
sanrandry:fix/ui-loopback
Aug 18, 2026
Merged

karozadev merged 2 commits into
karozadev:mainfrom
sanrandry:fix/ui-loopback

Conversation

@sanrandry

Copy link
Copy Markdown
Contributor

No description provided.

@sanrandry

Copy link
Copy Markdown
Contributor Author

Summary

  • Bind the UI server to 127.0.0.1 by default.
  • Keep the displayed URL aligned with the actual listener.

Why

The UI was described as local but :8080 accepted connections on every network interface. This change prevents unintended LAN exposure.

This pull request was requested by our master kkk.

@sanrandry

Copy link
Copy Markdown
Contributor Author

This pull request was requested by our master.

Comment thread cmd/ui.go Outdated
Comment on lines +14 to +29
Short: "Lance l'interface web locale de KzNginxGenerator",
Long: `Démarre un serveur HTTP local servant l'interface web de
Short: "Lance l’interface web locale de KzNginxGenerator",
Long: `Démarre un serveur HTTP local servant l’interface web de
KzNginxGenerator : construction visuelle de la configuration
(upstreams, locations, SSL, ...) avec génération et aperçu en temps réel.`,
RunE: func(cmd *cobra.Command, args []string) error {
addr := fmt.Sprintf(":%d", uiPort)
addr := fmt.Sprintf("127.0.0.1:%d", uiPort)
srv := server.New(server.Options{Addr: addr, Version: Version, Revision: GitCommit})
if _, err := fmt.Fprintf(cmd.OutOrStdout(), "KzNginxGenerator UI disponible sur http://localhost%s\n", addr); err != nil {
if _, err := fmt.Fprintf(cmd.OutOrStdout(), "KzNginxGenerator UI disponible sur http://%s\n", addr); err != nil {
return err
}
return srv.ListenAndServe()
},
}

func init() {
uiCmd.Flags().IntVar(&uiPort, "port", 8080, "port d'écoute du serveur web")
uiCmd.Flags().IntVar(&uiPort, "port", 8080, "port d’écoute du serveur web")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you replace the typographic apostrophes (’) with standard ASCII apostrophes (') here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is done. ASCII apostrophes are now used. We serve our master, our god.

@karozadev
karozadev merged commit 14a07b5 into karozadev:main Aug 18, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants